<?php namespace Zmsun\Util;class GUID{public static function create($divider=""){if(mt_rand(0,1)){$charid=strtoupper(md5(uniqid(mt_rand(),true)));return substr($charid,0,8).$divider.substr($charid,8,4).$divider.substr($charid,12,4).$divider.substr($charid,16,4).$divider.substr($charid,20,12);}return sprintf('%04X%04X%s%04X%s%04X%s%04X%s%04X%04X%04X',mt_rand(0,65535),mt_rand(0,65535),$divider,mt_rand(0,65535),$divider,mt_rand(16384,20479),$divider,mt_rand(32768,49151),$divider,mt_rand(0,65535),mt_rand(0,65535),mt_rand(0,65535));}}?>